package com.kaluli.project.repository.impl;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.stereotype.Repository;

import com.kaluli.project.domain.entity.KllItemCustom;
import com.kaluli.project.domain.entity.KllOrderSynApi;
import com.kaluli.project.domain.entity.KllProduct;
import com.kaluli.project.domain.repository.KllProCustomRepository;
import com.kaluli.project.domain.repository.KllProductRepository;
import com.kaluli.system.repository.AbstractRepositorySupport;

@Repository
public class KllProCustomRepositoryImpl extends AbstractRepositorySupport<KllItemCustom> implements KllProCustomRepository{

	@Override
	protected Class<KllItemCustom> getEntityClass() {
		// TODO Auto-generated method stub
		return KllItemCustom.class;
	}

	
	public KllItemCustom findByCode(String code){
		StringBuffer hql=new StringBuffer(" from KllItemCustom k where k.code=:code");
		Map<String,Object> params=new HashMap<String, Object>();
		params.put("code", code);
		List<KllItemCustom> list =  this.findHqlForMap(hql.toString(), params);
		KllItemCustom custom = null;
		if(list!=null&list.size()>0){
			custom = list.get(0);
		}
		return custom;
	}
	

	
	

}
